import { defHttp } from '/@/utils/http/axios';

export class ModelMgmtApi {
  static findPage(params) {
    return defHttp.get({ url: '/model/getPageData', params });
  }

  static findUpdateRecords(params) {
    return defHttp.get({ url: '/updateRecord/getList', params });
  }

  static add(data: FormData) {
    return defHttp.post({ url: '/model/add', data }, { isTransformResponse: false });
  }

  static update(data: FormData) {
    return defHttp.post({ url: '/model/update', data }, { isTransformResponse: false });
  }

  static getDetail(params: { id: string }) {
    return defHttp.get({ url: '/model/getDetail', params }, { isTransformResponse: false });
  }

  static duplicate(data: { id: string }) {
    return defHttp.post({ url: '/model/duplicate', data }, { isTransformResponse: false });
  }

  static getDetail2(params: { id: string }) {
    return defHttp.get({ url: '/model/getDetail2', params }, { isTransformResponse: false });
  }

  static doEditNewVersion(data: {ids: string}) {
    // return defHttp.post({ url: '/updateRecord/updateNewVersion', data }, { isTransformResponse: false });
    return defHttp.get({ url: '/updateRecord/updateNewVersion?ids='+data.ids, data });
  }
  //---------------------------------------------------------------------------------------------
}
